//备注：拷贝代码请加上作者信息
//作者：王海涛
//邮箱：1126471088@qq.com
//版本：V1.0.0
/********************************************************
    说明：
    1、基于模拟GPIO控制。
    2、使用私有GPIO_BSP驱动。
    3、应用留意tm1650_main.c内的代码。
**********************************************************/
#ifndef __TM1650_DRIVER_H__
#define __TM1650_DRIVER_H__

#include <string.h>
#include <stdint.h>
#include "FreeRTOS.h"
#include "task.h"
#include "semphr.h"
#include "../../BSP/I2C_BSP/i2c_bus.h"
#include "../../Tool/Soft_I2C/soft_i2c_bus.h"
#include "../../Delay/delay.h"

/*开启软件模拟I2C*/
//#define TM1650_Soft_I2C

typedef enum
{
    TM1650_Brightness_0 = 0, /*亮度0级*/
    TM1650_Brightness_1 = 1, /*亮度1级*/
    TM1650_Brightness_2 = 2, /*亮度2级*/
    TM1650_Brightness_3 = 3, /*亮度3级*/
    TM1650_Brightness_4 = 4, /*亮度4级*/
    TM1650_Brightness_5 = 5, /*亮度5级*/
    TM1650_Brightness_6 = 6, /*亮度6级*/
    TM1650_Brightness_7 = 7, /*亮度7级*/
    TM1650_Brightness_8 = 8, /*亮度8级*/

    TM1650_Segment_8bit = 0, /*8段输出*/
    TM1650_Segment_7bit = 1, /*7段输出*/

    TM1650_Default_Mode = 0, /*正常模式*/
    TM1650_Standby_Mode = 1, /*待机模式*/
}WHT_TM1650_State_enum;

typedef struct
{
	void (*WHT_Init)(void);
    void (*WHT_Set_Brightness)(WHT_TM1650_State_enum brightness);
    void (*WHT_Set_Segment)(WHT_TM1650_State_enum segment);
    void (*WHT_Set_mode)(WHT_TM1650_State_enum mode);
    void (*WHT_Set_Display_Value)(uint32_t value_32bit);
    uint8_t (*WHT_Get_Kyes_Value)(void);
	uint8_t (*WHT_Scan_I2C_Slave_Count)(void);
}WHT_TM1650_Driver_t;

extern const WHT_TM1650_Driver_t WHT_TM1650_Driver;


#endif /* __TM1650_DRIVER_H__ */
